package com.medata.service.impl;

import com.medata.dataObject.Category;
import com.medata.repository.CategoryRepository;
import com.medata.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：zb
 * @date ：Created in 2019/5/14 0014 10:37
 * @description：
 */
@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryRepository categoryRepository;
    @Override
    public Category findByDbid(Integer id) {
        Category category = categoryRepository.findByDbid(id);
        return category;
    }

    @Override
    public List<Category> findAll() {
        List<Category> all = categoryRepository.findAll();
        return all;
    }

    @Override
    public Category findByDc(String dc) {
        Category category = categoryRepository.findByDc(dc);
        return category;
    }

    @Override
    public Category findByDba(String dba) {
        return categoryRepository.findByDba(dba);
    }
}
